import cloudbase from "@cloudbase/js-sdk";

// 将你的环境 Id 填写到此处
const envId = "********";

let app;
let auth;
let db;

if (!app) {
  app = cloudbase.init({
    env: envId,
  });
}

if (!auth) {
  auth = app.auth({
    persistence: "local",
  });
}

if (!db) {
  db = app.database();
}

export { auth, db };
